import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'root',
    component: () => import('@/views/layout/Root.vue'),
    children: [
      {
        path: 'user',
        name: 'user',
        component: () => import('@/views/setting/user/index.vue')
      },
      {
        path: 'role',
        name: 'role',
        component: () => import('@/views/setting/role/index.vue')
      },
      {
        path: 'permission',
        name: 'permission',
        component: () => import('@/views/setting/permission/index.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
